md-toolbar
	.md-toolbar-tools
		h2 Team
		span(flex)
		md-button.md-icon-button(ng-click="vm.closeDialog()")
			md-icon.angular-material-icons(aria-label="Close dialog") close

md-content(layout-margin)
	div(ng-switch="vm.toShow")
		div(ng-switch-when="0")
			.cardInfo
				p You do not currently have any licenses. A minimum of two is required to add team members.
				br
				p
					| Please go to the
					=" "
					a(href="", ng-click="vm.goToPage('billing')") Billing Page
					=" "
					| to add licenses.

		div(ng-switch-when="1")
			.cardInfo
				p You currently have one license. A minimum of two is required to add team members.
				br
				p
					| Please go to the
					=" "
					a(href="", ng-click="vm.goToPage('billing')") Billing Page
					=" "
					| to add licenses.

		div(ng-switch-when="1+")
			#project(layout="row", layout-align="start center")
				md-button.md-icon-button(aria-label="Dashboard")
					md-icon.angular-material-icons(ng-if="!vm.item.federate") dashboard
					md-icon.angular-material-icons(ng-if="vm.item.federate") border_all
				p(flex) {{vm.item.project}}

			div(ng-if="vm.noLicensesAssigned")
				.cardInfo
					p You do not have any licenses assigned to other users. You currently have {{vm.numSubscriptions - 1}} license(s) unassigned.
					br
					p
						| Please go to the
						=" "
						a(href="", ng-click="vm.goToPage('licenses')") Licenses Page
						=" "
						| to assign a license.

			div(ng-if="!vm.noLicensesAssigned")
				md-autocomplete(
				ng-if="vm.showList"
				md-selected-item="vm.selectedUser"
				md-search-text="vm.searchText"
				md-items="user in vm.querySearch(vm.searchText)"
				md-item-text="user.user"
				md-min-length="0"
				placeholder="Select a team member"
				flex
				ng-disabled="vm.allLicenseAssigneesMembers")
					md-item-template
						span(md-highlight-text="vm.searchText", md-highlight-flags="^i") {{user.user}}
					md-not-found
						span No user matching "{{ctrl.searchText}}" was found.
				md-button.md-raised.md-accent#accountTeamAdd(ng-click="vm.addMember()", ng-disabled="vm.addDisabled") Add

			md-divider(ng-if="!vm.noLicensesAssigned")

			// Assigned
			md-list(ng-if="!vm.noLicensesAssigned")
				md-subheader.md-no-sticky
					| Team
					=" "
					span#accountTeamSubHeader ({{vm.members.length}} member)
				md-list-item(ng-repeat="member in vm.members")
					md-icon.angular-material-icons.collaboratorIcon(aria-label="Person") person
					.md-list-item-text
						div(layout="row")
							p {{member.user}}
							//p#accountTeamMemberRole ({{member.role}})
					span(flex)
					md-button.md-icon-button.md-accent(ng-click="vm.removeMember($index)")
						md-icon.angular-material-icons(aria-label="Close dialog") remove_circle
